<script setup>
import { useRouter } from 'vue-router'

const router = useRouter()

const props = defineProps({
  title: {
    type: String,
    default: '发现好视频'
  },
  subtitle: {
    type: String,
    default: '开源精品与经典佳作，轻松畅看'
  },
  showCTA: {
    type: Boolean,
    default: true
  }
})


</script>

<template>
  <section class="hero">
    <div class="hero-inner">
      <div class="hero-bg-container">
        <img src="/images/banner.svg" alt="banner" class="hero-bg" aria-hidden="true" />
        <div class="hero-gradient"></div>
        <div class="hero-glow"></div>
      </div>
      <div class="hero-content">
        <h1 class="hero-title">{{ title }}</h1>
        <p class="hero-subtitle">{{ subtitle }}</p>
        <div v-if="showCTA" class="hero-cta"></div>
      </div>
    </div>
  </section>
</template>

<style scoped>
.hero {
  margin: 0 0 32px;
  position: relative;
}

.hero-inner {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid var(--border);
  background: linear-gradient(135deg, #ffffff 0%, #e8edff 50%, #f3f6ff 100%);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--border);
  min-height: 300px;
  display: flex;
  align-items: center;
}

.hero-bg-container {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.hero-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.7) saturate(1.1);
  transform: scale(1.02);
  animation: slowZoom 20s infinite alternate ease-in-out;
  opacity: 0.4;
  mix-blend-mode: overlay;
}

@keyframes slowZoom {
  0% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1.08);
  }
}

.hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.3));
}

.hero-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  height: 80%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, transparent 70%);
  filter: blur(30px);
  animation: glowPulse 8s infinite alternate ease-in-out;
}

@keyframes glowPulse {
  0% {
    opacity: 0.6;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(1.1);
  }
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 40px;
  max-width: 600px;
}

.hero-title {
  margin: 0 0 12px;
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--fg);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  animation: fadeIn 0.8s ease-out;
}

.hero-subtitle {
  margin: 0 0 24px;
  font-size: 1.25rem;
  color: var(--muted);
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
  animation: fadeIn 0.8s ease-out 0.2s both;
}

.hero-cta {
  display: flex;
  justify-content: center;
  margin-top: 24px;
  animation: fadeIn 0.8s ease-out 0.4s both;
}

.cta-btn {
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
  border: none;
  position: relative;
  overflow: hidden;
  will-change: transform;
}

.cta-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.cta-btn:hover::before {
  left: 100%;
}

.cta-btn.main {
  background: var(--accent);
  color: white;
  width: 100%;
  max-width: 200px;
}

.cta-btn.main:hover {
  background: var(--accent-hover);
}

.cta-btn:active {
  transform: translateY(0) scale(0.98);
}

/* 响应式设计 */
@media (max-width: 1024px) {
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-content {
    padding: 32px;
  }
}

@media (max-width: 768px) {
  .hero-inner {
    min-height: 250px;
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .hero-subtitle {
    font-size: 1rem;
  }
  
  .hero-content {
    padding: 24px;
  }
  
  .hero-cta {
    flex-direction: column;
    gap: 12px;
  }
  
  .cta-btn {
    width: 100%;
    max-width: 240px;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.75rem;
  }
  
  .hero-content {
    padding: 20px;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
</style>